The present invention relates to a method of controlling a servomotor for actuating feed shafts of a machine tool or robot arms, and more particularly, to a feedforward control for a servomotor.